package com.palm.dev;

import cn.beecp.BeeDataSource;
import org.noear.solon.Solon;
import org.noear.solon.annotation.Bean;
import org.noear.solon.annotation.Configuration;
import org.noear.solon.annotation.Inject;
import org.noear.solon.extend.staticfiles.StaticMimes;

import javax.sql.DataSource;

@Configuration
public class DevApp {
    public static void start(String[] args){
        //DevConfig.basePackage="com.palm.enrollment";
        //StaticMimes.instance().put(".vue", "text/html");
        StaticMimes.add(".vue","text/html");
        DevConfig.basePath=DevApp.class.getClassLoader().getResource("./").getPath().replaceFirst("target/test-classes/","");
        Solon.start(DevApp.class,new String[]{"--server.port=5200"});
        System.out.println("start at: http://localhost:5200/dev.html#/models");
    }
    @Bean
    public DataSource db1(@Inject("${datasource}") BeeDataSource ds) {
        return ds;
    }
}
